/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Taikhoan;

/**
 *
 * @author Sinz
 */
public class Account {
    private String name;
    private String password;
    //phân quyền cho tài khoản
    /* 1 -> admin
       2 -> manager
       3 -> seller
    */
    private int potential;
    

    //constructor
    public Account(String name, String password) {
        this.name = name;
        this.password = password;
        this.potential = 3;
    }

    public Account(String name, String password, int potential) {
        this.name = name;
        this.password = password;
        this.potential = potential;
    }
    
    //getter
    public String getName() {
        return name;
    }

    public String getPassword() {
        return password;
    }

    public int getPotential() {
        return potential;
    }
    //setter

    public void setName(String name) {
        this.name = name;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setPotential(int potential) {
        this.potential = potential;
    }
    
    // authorization
    public boolean autAccount(String name, char[] pass){
        String passString = new String(pass);
        return this.name.equals(name) && this.password.equals(passString);
    }
    
}
